with Ada.Finalization;
with Websites;


generic

   --
   -- Website properties, contents
   --
   --    clients of this package provide 'Websites' formal parameter,
   --    optionally supplying values for its generics parameters or
   --    using default(s) values
   --

   with package Websites_Pkg_Parameter is new Websites(

         Content_Size_Max => <>,

         URL_Length_Max   => <>,

         others => <> );

   -- instance of Website with an implementation of its interface for
   --       encapsulation methods
   --

package Websites_Prototypes is

   --
   -- access the supplied formal package parameter
   --

   package Websites_Pkg_Proto renames Websites_Pkg_Parameter;

   use Websites_Pkg_Proto;

   --
   -- interface
   --

   type Website_Object_Interface is new Website_Object_Interface_Type
      with null record;

   --
   -- Website
   --

   type Website_Prototype_Type is private;


   --
   -- implement Website_Object_Interface
   --

   --
   -- encapsulation methods
   --

   --
   -- contents
   --

   overriding
   function Get_Contents( Website_Instance : in Website_Object_Interface )

         return Contents_Str_Sub_Type;

   overriding
   procedure Set_Contents( Website_Instance : in out Website_Object_Interface;

                           Website_Contents : in Contents_Str_Sub_Type;

                           Append : Boolean := false );

   overriding
   function Size( Website_Instance : in Website_Object_Interface )

                 return Contents_Int_Sub_Type;

   overriding
   procedure Erase( Website_Instance : in out Website_Object_Interface );


   --
   -- URL
   --

   overriding
   procedure Set_URL( Website_Instance : in out Website_Object_Interface;

                      URL : in URL_Str );

   overriding
   function Get_URL( Website_Instance : in Website_Object_Interface )

         return URL_Str;



   overriding
   function Percentage_Space_Used( Website_Instance : in

         Website_Object_Interface )

         return Integer;


private


   --
   -- Website type with custom initialization, destruction
   --

   type Website_Prototype_Type is new Ada.Finalization.Controlled with record

      Website_Record : Websites_Pkg_Proto.Website;

   end record;


   --
   -- declare initializer, destructor before first instance is declared
   --


   --
   -- initializer
   --

   overriding
   procedure Initialize( Website_Prototype : in out Website_Prototype_Type );


   --
   -- destructor
   --

   overriding
   procedure Finalize( Website_Prototype : in out Website_Prototype_Type );


   --
   -- single Website instance referred to by encapsulation methods
   --

   Website_Prototype : Website_Prototype_Type;


end Websites_Prototypes;